////////////////////////////////////////////////
// DESCRIPTION:
//    Core emulator Program startup
//

using System;
using Microsoft.SPOT.Hardware;
using FusionWare.SPOT.EmulatorComponents;

namespace $safeprojectname$
{
    /// <summary>Emulator component for this platform</summary>
    /// <remarks>
    /// This custom emulator ties all the components into a single UI form thus making for a
    /// clean user experience. 
    /// </remarks>
    class $safeprojectname$ : CustomEmulator
    {
        public $safeprojectname$()
        {
            base.MainForm = new PlatformMainForm();
        }

        /// <summary>Aliased pin names for this platform configuration</summary>
        new enum Pins
        {
            SW1 = 1,
            SW2 = 2,
            SW3 = 3,
            SW4 = 4,
            SW5 = 5,
            SW6 = 6,
            SW7 = 7,
            SW8 = 8,
            SW9 = 9
        }

        /// <summary>Resolves a pin name to its actual pin number on this platform</summary>
        /// <param name="Name">Name of the pin to resolve</param>
        /// <returns>pin associated with the given pin name</returns>
        public override Cpu.Pin GetPinByName(string Name)
        {
            try
            {
                return (Cpu.Pin)Enum.Parse(typeof(Pins),Name, true);
            }
            catch
            {
                return base.GetPinByName(Name);
            }
        }
        
        /// <summary>The main entry point for the emulator.</summary>
        /// <remarks>
        /// Entry point for the emulator. Creates a new $safeprojectname$
        /// instance and starts running it. 
        /// </remarks>
        [STAThread]
        static void Main(string[] Args)
        {
            new $safeprojectname$().Start(Args);
        }
    }
}